//
//  HomeUserInfoDynamicImageContentCell.m
//  ShowYork
//
//  Created by hxh on 2021/3/5.
//  Copyright © 2021 hxh. All rights reserved.
//

#import "HomeUserInfoDynamicImageContentCell.h"

@interface HomeUserInfoDynamicImageContentCell ()
@property (nonatomic,strong)UILabel *contentLb;
@property (nonatomic,strong)UILabel *subTitleLb;
@end

@implementation HomeUserInfoDynamicImageContentCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUI];
    }
    return self;
}
- (void)setUI{
    self.contentLb = [[UILabel alloc]init];
    self.contentLb.textColor = C51;
    self.contentLb.font = font(14);
    self.contentLb.numberOfLines = 3;
    [self.contentView addSubview:self.contentLb];
    
    self.subTitleLb = [[UILabel alloc]init];
    self.subTitleLb.text = @"共1张";
    self.subTitleLb.textColor = C153;
    self.subTitleLb.font = font(12);
    [self.contentView addSubview:self.subTitleLb];
    
    [self.contentLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(16);
        make.right.equalTo(self.contentView).offset(-16);
        make.top.equalTo(self.contentView);
    }];
    
    [self.subTitleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(16);
    }];
    
}

- (void)setModel:(HomePageItemModel *)model{
    _model = model;
    self.subTitleLb.text = model.createDetailTimeStr;
    if (model.contentType.intValue == 2 && model.contents.count > 0) {
        self.subTitleLb.text = [NSString stringWithFormat:@"%@ · 共%lu张",model.createDetailTimeStr,(unsigned long)model.contents.count];
    }
    self.contentLb.text = model.contentText;
    
}


@end
